/* 视频会议房间样式 */

.container {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  position: relative;
}

.header {
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  position: relative;
}

.header h2 {
  margin: 0;
  font-size: 24px;
}

.header p {
  margin: 5px 0 0 0;
  font-size: 14px;
  opacity: 0.8;
}

.headerButtons {
  display: flex;
  gap: 10px;
}

.userListButton,
.chatButton,
.shareButton,
.leaveButton {
  padding: 10px 15px;
  font-size: 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.2);
}

.userListButton:hover,
.chatButton:hover,
.shareButton:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.leaveButton {
  background: rgba(255, 59, 48, 0.8);
}

.leaveButton:hover {
  background: rgba(255, 59, 48, 1);
  transform: scale(1.1);
}

.chatButton {
  position: relative;
}

.unreadBadge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff3b30;
  color: white;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: bold;
}

.copySuccessToast {
  position: absolute;
  top: 70px;
  right: 20px;
  background: #4caf50;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: slideInDown 0.3s ease;
  z-index: 1000;
}

@keyframes slideInDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow: auto;
}

.videoGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 1400px;
  max-height: 100%;
}

.videoContainer {
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.videoElement {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.videoOffOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #434343 0%, #000000 100%);
  font-size: 48px;
  color: #fff;
}

.videoOffOverlay span {
  font-size: 16px;
  margin-top: 10px;
}

.waitingContainer {
  position: relative;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.waitingMessage {
  text-align: center;
  color: #fff;
}

.waitingSpinner {
  font-size: 48px;
  margin-bottom: 20px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.waitingMessage p {
  margin: 10px 0;
  font-size: 18px;
  font-weight: 500;
}

.waitingHint {
  font-size: 14px;
  opacity: 0.8;
  margin-top: 10px;
}

.videoLabel {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.7);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}

.controls {
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  gap: 20px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.controlButton {
  width: 60px;
  height: 60px;
  font-size: 28px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.controlButton:hover {
  transform: scale(1.1);
}

.videoButtonOn,
.audioButtonOn,
.screenButtonOff {
  background: rgba(76, 175, 80, 0.8);
}

.videoButtonOff,
.audioButtonOff {
  background: rgba(255, 59, 48, 0.8);
}

.screenButtonOn {
  background: rgba(255, 149, 0, 0.8);
}

/* 用户列表面板 */
.usersPanel {
  position: fixed;
  top: 0;
  right: -350px;
  width: 350px;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
  transition: right 0.3s ease;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.usersPanel.open {
  right: 0;
}

.panelHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panelHeader h3 {
  margin: 0;
  font-size: 20px;
  color: white;
}

.closeButton {
  background: none;
  border: none;
  color: white;
  font-size: 32px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.closeButton:hover {
  transform: scale(1.2);
}

.usersList {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.userItem {
  padding: 15px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: background 0.2s ease;
}

.userItem:hover {
  background: rgba(255, 255, 255, 0.1);
}

.userItem.me {
  background: rgba(76, 175, 80, 0.2);
}

.userInfo {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.userName {
  font-size: 16px;
  font-weight: 500;
  color: white;
}

.localUserTag {
  color: #4caf50;
  font-weight: bold;
}

.userStatus {
  font-size: 18px;
}

/* 聊天面板 */
.chatPanel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
  transition: right 0.3s ease;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.chatPanel.open {
  right: 0;
}

.chatPanelHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chatPanelHeader h3 {
  margin: 0;
  font-size: 20px;
  color: white;
}

.messagesList {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 12px;
  word-wrap: break-word;
}

.myMessage {
  align-self: flex-end;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.otherMessage {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.messageSender {
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 5px;
  opacity: 0.8;
}

.messageContent {
  font-size: 14px;
  line-height: 1.4;
}

.messageTime {
  font-size: 11px;
  margin-top: 5px;
  opacity: 0.6;
}

.chatInputContainer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 10px;
}

.chatInput {
  flex: 1;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: white;
  font-size: 14px;
}

.chatInput:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.1);
}

.chatInput::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.sendButton {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.sendButton:hover {
  transform: scale(1.05);
}

/* 退出会议弹窗 */
.modalOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modalContent {
  background: white;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modalTitle {
  margin: 0 0 15px 0;
  font-size: 24px;
  color: #333;
}

.modalMessage {
  margin: 0 0 25px 0;
  font-size: 16px;
  color: #666;
  line-height: 1.5;
}

.modalActions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
}

.modalButton {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cancelButton {
  background: #f0f0f0;
  color: #333;
}

.cancelButton:hover {
  background: #e0e0e0;
}

.confirmButton {
  background: #ff3b30;
  color: white;
}

.confirmButton:hover {
  background: #e62e24;
  transform: scale(1.05);
}

/* 背景遮罩 */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  transition: background 0.3s ease;
  z-index: 99;
}

.overlay.active {
  background: rgba(0, 0, 0, 0.5);
  pointer-events: all;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .videoGrid {
    grid-template-columns: 1fr;
  }

  .usersPanel,
  .chatPanel {
    width: 100%;
    right: -100%;
  }

  .usersPanel.open,
  .chatPanel.open {
    right: 0;
  }

  .controls {
    gap: 10px;
  }

  .controlButton {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }
}